Zip(TFirst, TSecond, TResult) Method (ParallelQuery(TFirst), ParallelQuery(TSecond), Func(TFirst, TSecond, TResult))

Task Parallel System.Threading

Merges in parallel two sequences by using the specified predicate function.

Namespace:  System.Linq
Assembly:  System.Threading (in System.Threading.dll)

Syntax

Visual Basic (Declaration)
Public Shared Function Zip(Of TFirst, TSecond, TResult) ( _
	first As ParallelQuery(Of TFirst), _
	second As ParallelQuery(Of TSecond), _
	resultSelector As Func(Of TFirst, TSecond, TResult) _
) As ParallelQuery(Of TResult)
C#
public static ParallelQuery<TResult> Zip<TFirst, TSecond, TResult>(
	ParallelQuery<TFirst> first,
	ParallelQuery<TSecond> second,
	Func<TFirst, TSecond, TResult> resultSelector
)

Parameters

first
Type: System.Linq..::.ParallelQuery<(Of <(TFirst>)>)
The first sequence to zip.
second
Type: System.Linq..::.ParallelQuery<(Of <(TSecond>)>)
The second sequence to zip.
resultSelector
Type: System..::.Func<(Of <(TFirst, TSecond, TResult>)>)
A function to create a result element from two matching elements.

Type Parameters

TFirst
The type of the elements of the first sequence.
TSecond
The type of the elements of the second sequence.
TResult
The type of the return elements.

Return Value

A sequence that has elements of type TResult that are obtained by performing resultSelector pairwise on two sequences. If the sequence lengths are unequal, this truncates to the length of the shorter sequence.

Exceptions

ExceptionCondition
System..::.ArgumentNullException first or second or resultSelector is a null reference (Nothing in Visual Basic).

See Also